// Raf Lempens & Bjorn Schobben
#include "TargetStep.h"

TargetStep::TargetStep(): targetsetableInterface(0), targetsetableObject(0), target(0)
{
}

TargetStep::TargetStep(const TargetStep& rhs): targetsetableInterface(rhs.targetsetableInterface), targetsetableObject(rhs.targetsetableObject), target(rhs.target)
{
}

TargetStep::~TargetStep()
{
}

void TargetStep::Execute()
{
	if (targetsetableInterface && targetsetableObject && target)
	{
		targetsetableInterface->SetTarget(target);
	}
}

void TargetStep::SetObject(GameObject* object, Targetsetable* targetsetable)
{
	targetsetableInterface = targetsetable;
	targetsetableObject = object;
}

void TargetStep::SetTarget(GameObject* object)
{
	target = object;
}


TargetStep* TargetStep::Clone() const
{
	return new TargetStep(*this);
}
